<?php
/**
 * Class descript.
 * User: chan
 * Date: 2017/10/20 11:22
 */
namespace app\api\validate;
class Login extends BaseValidate
{
    public function checkLoginParam()
    {
         $this->rule = [
            //'mobile' => 'require|isMobile',
            //'password' => 'require|isNotEmpty',
             'openid' => 'require|isNotEmpty',
        ];
         $this->message = [
            //'mobile.require' => '手机号码必填',
            //'mobile.isMobile' => '手机号码格式错误',
            //'password' => '密码必填',
             'openid' => 'openid必填',
        ];
        $this->checkParam();
    }
    public function checkRegisterParam()
    {
        $this->rule = [
            'mobile' => 'require|isMobile',
            'sex' => 'require|isNotEmpty',
            'code' => 'require|isNotEmpty',
            'avatarUrl' => 'require|isNotEmpty',
            //'nickname' => 'require|check_string_length',
            'openid' => 'require|isNotEmpty',
            // 'province' => 'require|isNotEmpty',
            // 'city' => 'require|isNotEmpty',
            // 'country' => 'require|isNotEmpty',
        ];
        $this->message = [
            'mobile.require' => '手机号码必填',
            'mobile.isMobile' => '手机号码格式错误',
            'sex' => '性别必填',
            'code' => '验证码必填',
            'avatarUrl' => '头像必传',
            //'nickname' => '参数必填或昵称长度不能超过5个字节',
            'openid' => 'openid必传',
            // 'province' => '省份必传',
            // 'city' => '城市必传',
            // 'country' => '区域必传',
        ];
        $this->checkParam();
    }
}